Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CPP on Instances.TH.Lift import #931

Merged
merged 1 commit into from
May 11, 2021

Conversation

sjakobi
Copy link
Member

@sjakobi sjakobi commented May 11, 2021

This prevents a build error with GHC 8.10.1 and 8.10.2 which bundle
text-1.2.3.2:

src/Nix/Expr/Types.hs:497:21: error:
    • Could not deduce (TH.Lift Text) arising from a use of ‘TH.lift’
      from the context: Data b
        bound by a type expected by the context:
                   forall b. Data b => b -> Maybe (TH.Q TH.Exp)
        at src/Nix/Expr/Types.hs:(490,7)-(498,7)
      or from: b ~ Text
        bound by a pattern with constructor:
                   HRefl :: forall k1 (a :: k1). a :~~: a,
                 in a pattern binding in
                      a 'do' block
        at src/Nix/Expr/Types.hs:493:11-15
    • In the expression: TH.lift b
      In the first argument of ‘pure’, namely
        ‘[| $(TH.lift b) |]
         pending(rn) [<splice, TH.lift b>]’
      In a stmt of a 'do' block:
        pure
          [| $(TH.lift b) |]
          pending(rn) [<splice, TH.lift b>]
    |
497 |           pure [| $(TH.lift b) |]
    |                     ^^^^^^^^^

I had noticed the build failure in the Hackage build matrix: https://matrix.hackage.haskell.org/#/package/hnix/0.13.0/ghc-8.10.1@1620752895

This prevents a build error with GHC 8.10.1 and 8.10.2 which bundle
text-1.2.3.2:

    src/Nix/Expr/Types.hs:497:21: error:
        • Could not deduce (TH.Lift Text) arising from a use of ‘TH.lift’
          from the context: Data b
            bound by a type expected by the context:
                       forall b. Data b => b -> Maybe (TH.Q TH.Exp)
            at src/Nix/Expr/Types.hs:(490,7)-(498,7)
          or from: b ~ Text
            bound by a pattern with constructor:
                       HRefl :: forall k1 (a :: k1). a :~~: a,
                     in a pattern binding in
                          a 'do' block
            at src/Nix/Expr/Types.hs:493:11-15
        • In the expression: TH.lift b
          In the first argument of ‘pure’, namely
            ‘[| $(TH.lift b) |]
             pending(rn) [<splice, TH.lift b>]’
          In a stmt of a 'do' block:
            pure
              [| $(TH.lift b) |]
              pending(rn) [<splice, TH.lift b>]
        |
    497 |           pure [| $(TH.lift b) |]
        |                     ^^^^^^^^^
@Anton-Latukha
Copy link
Collaborator

Thank you.

@Anton-Latukha Anton-Latukha merged commit 0c8b72a into haskell-nix:master May 11, 2021
@Anton-Latukha
Copy link
Collaborator

Anton-Latukha commented May 11, 2021

Yes.
I already forgot that I then saw/read about the new Text instance while doing that code.
I probably had not remebered why it is so.

How did you know this stuff? ;)

@Anton-Latukha
Copy link
Collaborator

Anton-Latukha commented May 11, 2021

@sjakobi: Published hnix 0.13.0.1 with the fix, Hackage built it with the 8.10.1: https://matrix.hackage.haskell.org/#/package/hnix/.

HNix so far can not give GHC 9.0, the work upstream comes next to allow it. After that the release would be made just to provide GHC support.

@sjakobi sjakobi deleted the fix-text-bound branch May 11, 2021 21:35
@sjakobi
Copy link
Member Author

sjakobi commented May 11, 2021

Thanks for the bug fix release @Anton-Latukha! :)

I just happened to see the build failure on the Hackage matrix page and then figured it out after looking at https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history and the text changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants